<?php
/* @var $this NewsController */
/* @var $model News */
/* @var $form CActiveForm */
?>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'news-form',
        'enableAjaxValidation' => false,
    ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'title'); ?>
        <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 512)); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'description'); ?>
        <?php echo $form->textArea($model, 'description', array('maxlength' => 2048)); ?>
        <?php echo $form->error($model, 'description'); ?>
    </div>

<!--    <div class="row">
        <?php //echo $form->labelEx($model, 'status'); ?>
        <?php //echo $form->textField($model, 'status', array('size' => 45, 'maxlength' => 45)); ?>
        <?php //echo $form->error($model, 'status'); ?>
    </div>-->

    <div class="row">
        <?php echo $form->labelEx($model, 'expire_date'); ?>
        <?php //echo $form->textField($model,'expire_date'); ?>
        <?php
        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'options'=>array(
                'dateFormat' => "yy-mm-dd",
            ),
            'model' => $model,
            'attribute' => 'expire_date',            
            'htmlOptions' => array(
                'size' => '10', // textField size
                'maxlength' => '10', // textField maxlength
            ),
        ));
        ?>
        <?php echo $form->error($model, 'expire_date'); ?>
    </div>
    
    <div class="row agree">
        <?php echo $form->checkBox($model, 'email', array('size' => 1, 'maxlength' => 1)); ?>
        <?php echo $form->labelEx($model, 'email'); ?>
        <?php echo $form->error($model, 'email'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->